#include "stdafx.h"
#include "InnateSkill.h"
#include "MgrBase.h"
#include "ReactorDef.h"
#include "ValidatorBase.h"
#include "InstanceTouch.h"

DECL_INSTANCE_TOUCH(ETouch_InnateSkill);
struct InnateSkillDefReflectionRegister
{
	InnateSkillDefReflectionRegister()
	{
		REGISTER_REFLECTION_MEMBER(InnateSkillDef,m_iID,INVALID_ID).Editor_SetAsPrimaryKey();
		REGISTER_REFLECTION_MEMBER(InnateSkillDef,m_sDisplayName,std::string("DefaultName")).Editor_SetAsDisplayName();
		REGISTER_REFLECTION_MEMBER(InnateSkillDef,m_sName,std::string("")).Editor_SetAsRaw();
		REGISTER_REFLECTION_MEMBER(InnateSkillDef,m_iReactorID,INVALID_ID).Editor_SetAsForeignKey(eDefGroup_Default,eDefaultDef_Reactors);
		REGISTER_REFLECTION_MEMBER(InnateSkillDef,m_iContentValidator,INVALID_ID).Editor_SetAsForeignKey(eDefGroup_Default,eDefaultDef_ValidatorContext);
		REGISTER_REFLECTION_MEMBER(InnateSkillDef,m_iMaxCastCount,3).Editor_SetAsRaw();
	
		REGISTER_REFLECTION_MEMBER(InnateSkillDef,m_sConditonDesc,std::string("ConditonDesc")).Editor_SetAsRaw();
		REGISTER_REFLECTION_MEMBER(InnateSkillDef,m_sUsageDesc,std::string("")).Editor_SetAsRaw();
		REGISTER_REFLECTION_MEMBER(InnateSkillDef,m_sPic,std::string("Client Pic Resource")).Editor_SetAsRaw();
		REGISTER_REFLECTION_MEMBER(InnateSkillDef,m_sPic2,std::string("Client Pic Resource2")).Editor_SetAsRaw();

		GlobalClassManager::Instance().RegisterClass(InnateSkillDef::s_GetReflection(),eDefaultDef_InnateSkill);
		GlobalDefManager::Instance().RegisterDefManger(&InnateSkillDefManager::Instance());

	}
}_____innateskilldefreflectionregister;

rewrite  void InnateSkillDef::OnArchieveReaded()
{
	m_pContextValidator=ValidatorContextManager::Instance().LookupItem(m_iContentValidator);
	m_pReactor=ReactorDefManager::Instance().LookupItem(m_iReactorID);
}

